import sys, string, os, shutil   
srcdir = sys.path[0]; 
srcfiles = os.listdir(srcdir)  
for srcfile in srcfiles:
    srcfilename = os.path.splitext(srcfile)[0][1:]  
    sufix = os.path.splitext(srcfile)[1]  
    #print sufix,srcfilename
    name, ext = os.path.splitext(srcfile)
    print name, ext
    if sufix !='.py'and sufix =='.avi':
        destfile = srcdir + "//" + name  
        srcfile = os.path.join(srcdir, srcfile) 
        print destfile,srcfile
        os.rename(srcfile, destfile)  